﻿
@{
    ViewBag.Title = "征求意见";
    Layout = "~/Views/Shared/_FormLayout.cshtml";
}
@section HeadIncluder 
{
     <link href='@Url.Content("~/Content/public.css")' rel="stylesheet" />
    <link href='@Url.Content("~/Content/con_style.css")' rel="stylesheet" />
}
<table width="100%" class="left_xx" id="myTable">
    <tr>
        <td>"输入你想征求的问题"<a style="color: red; position: relative; top: 3px">*</a>
        </td>
    </tr>
    <tr>
        <td> <textarea id="txtQuestion" class="in_c1 validate[required]"  style="width: 98%;"cols="60" rows="3"></textarea>
        </td>
    </tr>
     <tr>
        <td> "征求对象" <a style="color: red; position: relative; top: 3px">*</a>
        </td>
    </tr>
     <tr>
        <td> 
           <textarea id="txtUserList" readonly="readonly"   class="in_c1  validate[required]"  style="width: 98%;"cols="60" rows="3"></textarea>
            <input id="hUserList"   type="hidden" />
                <button type="button" id="btnSelectEmployee"  onclick="SelectEmployee()" class="fj btn_c3 btn_s">选择</button> 
        </td>
    </tr>
     @*<tr>
        <td> 
            <input id="cbMsgNotify" type="checkbox" />短信提醒
            <input id="cbEmailNotify" type="checkbox" />邮件提醒
        </td>
    </tr>*@
</table>
 <div class="cxl">
      <input id="hProcessGUID"  value="@Request["ProcessGUID"]" type="hidden" />
      <input id="hAppInstanceID"   value="@Request["AppInstanceID"]" type="hidden" />
      
                <button type="button"   onclick="cancel()" class="fj btn_c3 btn_s">取消</button> 
                <button type="button" id="subbtn"  class="fj btn_c3 btn_s ui_state_highlight">确认</button> 
    </div>  
 <script type="text/javascript" src='@Url.Content("~/Scripts/lhgdialog.min.js")'> </script>
<script src=@Url.Content("/Scripts/jquery.form.js") type="text/javascript"></script>
<script src=@Url.Content("/Scripts/foa.form.js?v=20140904")  type="text/javascript"></script>
<script  type="text/javascript">
    function cancel() {
        window.top.oDG.close();
    }
    function RefreshValue(selectPostList) {
        if (selectPostList != null || selectPostList != undefined) {
            var arr = new Array();
            var str = "";
            $.each(selectPostList, function (i, item) {
                var obj = new Object();
                obj.Key = item.UserID;
                obj.Value = item.Name;
                arr.push(obj);
                str += item.Name + ";";
            });
            $("#txtUserList").val(str);
            $("#hUserList").val(JSON.stringify(arr));
        }
    }
    function SelectEmployee() {
        var url = '@Url.Action("EmployeeSelect","Employee")';
        OpenSelectUserPop(url, RefreshValue);
    }
    $(function () {
        $("#subbtn").click(function () {
            var url = '@Url.Action("SendConsulation","Form")';
            var ProcessGUID = $("#hProcessGUID").val();
            var AppInstanceID = $("#hAppInstanceID").val();
            var txtUserList = $("#txtUserList").val();
            var Question = $("#txtQuestion").val();
            var IsMsgNotifty = false;
            var IsEmailNotify = false;
            $.post(url, {
                ProcessGUID: ProcessGUID, AppInstanceID: AppInstanceID, UserList: $("#hUserList").val(),
                Question: Question, IsMsgNotifty: IsMsgNotifty, IsEmailNotify: IsEmailNotify
            }, function (data) {
                alert('发送到征求意见对象成功！');
                window.top.oDG1.close();
            });
        });
    });
</script>

